#include <stdio.h>
#include <windows.h>
#include <string.h>
#include <stdlib.h>

struct test_struct {
    char *iqn;
    int fd;
    int fragment_size;
    char *fragment_size_unit;
    char *type;
    char *name;
};

int main()
{
    printf("Hello world\n");
    char *defalut_config_string = "Type/iqn.2019-07.com.viptest.tcmu.target/bakcstorage_name/2MB";
    char *type = (char *) calloc(50, sizeof(char));
    char *fragment_size_unit = (char *) calloc(20, sizeof(char));
    char *name = (char *) calloc(20, sizeof(char));
    char *iqn = (char *) calloc(100, sizeof(char));
    char *size = (char *) calloc(50, sizeof(char));


    struct test_struct *test_demo;
    test_demo = (struct test_struct *) (calloc(1, sizeof(*test_demo)));
    sscanf(defalut_config_string, "%s/%s/%s/%d%s", type, iqn, name, size, fragment_size_unit);

    test_demo->iqn = strcat(iqn, "\0");
    printf("iqn : %s\n", test_demo->iqn);

    system("pause");
    return 0;
}
